﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>
        @Strings.WebPageTitle 
        @if(!string.IsNullOrEmpty(@ViewBag.Title))
        {
            @: - 
            @ViewBag.Title 
        }
    </title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/Content/themes/base/css")
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/tmngr")
    @RenderSection("scripts", required: false)
</head>
<body>
    <header>
        <div class="content-wrapper">
            <div id="logo">
                <a href="@Url.Action("Index", "Home", null)">
                    <img src="~/Images/Logo.png" alt="Logo"/>
                </a>
            </div>

            <div class="float-right">
                <section id="login">
                    @Html.Partial("_LoginPartial")
                </section>                
            </div>

            <ul id="menu">
                        
                @if (User.Identity.IsAuthenticated)
                {
                    <li>@Html.ActionLink(Strings.MenuMyDistricts, "Index", "MyDistricts")</li>
                    <li>@Html.ActionLink(Strings.MenuFreeDistricts, "Index", "FreeDistricts")</li>
                }
                else
                {
                    <li> </li>
                }
                    
                @if (User.IsInRole("Admin"))
                {                   
                    <li>@Html.ActionLink(Strings.MenuManageDistricts, "Index", "DistrictManage")</li>
                    <li>
                        @Html.ActionLink(Strings.MenuPendingReports + Html.Action("PendingReportsCount", "DistrictReport"), "Index", "DistrictReport", new { state =  MVCApp.Models.DistrictReport.ReportStates.Pending}, null)
                    </li>  
                    <li>@Html.ActionLink(Strings.MenuUsers, "Index", "Users")</li>
                    
                    if (User.Identity.Name.Equals("admin"))
                    {                     
                        <li>@Html.ActionLink(Strings.MenuCongregations, "Index", "Congregations")</li>
                    }
                }
            </ul>

            <div class="spacer"/>
        </div>
    </header>
    <div id="main-body">
        @RenderSection("featured", required: false)
        <section class="content-wrapper main-content clear-fix">
            <div class="content-margin">
                @RenderBody()
            </div>
        </section>
    </div>
    <footer>
        <div class="content-wrapper">
                <p>&copy; @DateTime.Now.Year - District Manager Application</p>
        </div>
    </footer>

   @Html.Partial("_GoogleAnalytics")
</body>
</html>
